/*
 * @Description: 素材管理相关 API
 * @Version: 1.0
 * @Author: Yuanjy
 * @Date: 2020-03-30 16:23:27
 * @LastEditors: Yuanjy
 * @LastEditTime: 2020-04-26 19:53:29
 */
import createAPI from '@/utils/axios'

const material = {
  // 文章管理相关API
  article: {
    add: config => createAPI('/admin/v1/article', 'POST', config),
    edit: config => createAPI('/admin/v1/article', 'PUT', config),
    del: id => createAPI('/admin/v1/article/' + id, 'DELETE', {}),

    getDetail: id => createAPI('/admin/v1/article/detail?id=' + id, 'GET', {}),
  },

  // 素材管理相关API
  material: {
    add: config => createAPI('/admin/v1/material', 'POST', config),
    edit: config => createAPI('/admin/v1/material', 'PUT', config),
    del: id => createAPI('/admin/v1/material/' + id, 'DELETE', {}),

    //文章加入到素材
    articleToMaterial: id => createAPI('/admin/v1/material/article-to-material?id=' + id, 'PUT', {}),
  }
}

export default material